// import 'package:flutter/cupertino.dart';
// import 'package:yundongjia_ble/yundongjia_ble.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_screenutil/screenutil.dart';
// import '../app_configure.dart';
// import '../general/misc/event_bus.dart';
// import 'component/slider_self.dart';
// import 'component/steer.dart';
// import 'component/return_button.dart';
// import 'device_data_context.dart';
// import 'entity/function_enum.dart';
// import 'function_page.dart';
// import 'remote_setting_40.dart';

// /*
//  * 遥控界面 4.0
//  * FunctionEntry -> RomotePage
//  */
// class RemotePage40 extends FunctionPage {
//   RemotePage40({
//     Key key,
//   }) : super(key: key);

//   @override
//   _RemotePage40State createState() => _RemotePage40State(FunctionType.Remote);
// }

// class _RemotePage40State extends FunctionPageState {
//   _RemotePage40State(FunctionType functionType)
//       : super(functionType: functionType);

//   // int _leftMeter = 0;
//   // int _rightMeter = 0;
//   int _cValue = 0;
//   int _dValue = 0;
//   bool _lockStatus = AppConfig.instance.controlLockStatus == 0;
//   bool _eStatus = false;
//   bool _fStatus = false;

//   List<String> btnImageNames = [
//     'assets/seires_1_level_1.png',
//     'assets/seires_1_level_2.png',
//     'assets/seires_1_level_3.png',
//   ];

//   List<GestureTapCallback> _btnFunction = [];

//   void settingBtnFunction() {
//     //setState(() {});
//   }

//   void switchBtnFunction() {
//     // double temp = _steerPosition;
//     // setState(() {
//     //   _steerPosition = _steerElse;
//     //   _steerElse = temp;
//     // });
//   }

//   double _steerPosition = ScreenUtil().setHeight(150);
//   double _steerElse;
//   @override
//   void initState() {
//     super.initState();
//     _btnFunction.add(settingBtnFunction);
//     _btnFunction.add(switchBtnFunction);
//     _btnFunction.add(switchBtnFunction);
//   }

//   // @override
//   // void dispose() {
//   //   YundongjiaBle.instance.stop();
//   //   super.dispose();
//   // }

//   @override
//   Widget build(BuildContext context) {
//     //print('remote build');
//     print('====== remote V4 build');
//     return background(
//       <Widget>[
//         ReturnButton(),
//         bluetootnBtn(shape: BoxShape.rectangle),
//         // channelA(),
//         // channelB(),
//         // channelC(),
//         // channelD(),
//         // rightMeter(valueChange: () {
//         //   return _rightMeter;
//         // }),
//         // leftMeter(valueChange: () {
//         //   return _leftMeter;
//         // }),
//         // _levelContainer(
//         //     ScreenUtil().setHeight(100), ScreenUtil().setHeight(290),
//         //     top: ScreenUtil().setHeight(240)),
//         _steer(),
//         _settings(),
//         _slider(),
//       ],
//       useBackground: false,
//     );
//   }

//   Widget channelA() {
//     return channelBtn(
//       right: ScreenUtil().setHeight(350.0),
//       top: ScreenUtil().setHeight(60.0),
//       width: ScreenUtil().setHeight(80.0),
//       height: ScreenUtil().setHeight(80.0),
//       imagename: (AppConfig.instance.channelASpeed == 1
//           ? 'assets/seires_1_a_on.png'
//           : 'assets/seires_1_a_off.png'),
//       ontap: () {
//         setState(() {
//           AppConfig.instance.channelASpeed =
//               AppConfig.instance.channelASpeed * -1;
//         });
//       },
//     );
//   }

//   Widget channelB() {
//     return channelBtn(
//       right: ScreenUtil().setHeight(240.0),
//       top: ScreenUtil().setHeight(60.0),
//       width: ScreenUtil().setHeight(80.0),
//       height: ScreenUtil().setHeight(80.0),
//       imagename: (AppConfig.instance.channelBSpeed == 1
//           ? 'assets/seires_1_b_on.png'
//           : 'assets/seires_1_b_off.png'),
//       ontap: () {
//         setState(() {
//           AppConfig.instance.channelBSpeed =
//               AppConfig.instance.channelBSpeed * -1;
//         });
//       },
//     );
//   }

//   Widget channelC() {
//     return channelBtn(
//       right: ScreenUtil().setHeight(130.0),
//       top: ScreenUtil().setHeight(60.0),
//       width: ScreenUtil().setHeight(80.0),
//       height: ScreenUtil().setHeight(80.0),
//       imagename: (AppConfig.instance.channelCSpeed == 1
//           ? 'assets/seires_1_c_on.png'
//           : 'assets/seires_1_c_off.png'),
//       ontap: () {
//         setState(() {
//           AppConfig.instance.channelCSpeed =
//               AppConfig.instance.channelCSpeed * -1;
//         });
//       },
//     );
//   }

//   Widget channelD() {
//     return channelBtn(
//       right: ScreenUtil().setHeight(20.0),
//       top: ScreenUtil().setHeight(60.0),
//       width: ScreenUtil().setHeight(80.0),
//       height: ScreenUtil().setHeight(80.0),
//       imagename: (AppConfig.instance.channelDSpeed == 1
//           ? 'assets/seires_1_d_on.png'
//           : 'assets/seires_1_d_off.png'),
//       ontap: () {
//         setState(() {
//           AppConfig.instance.channelDSpeed =
//               AppConfig.instance.channelDSpeed * -1;
//         });
//       },
//     );
//   }

//   Widget _leftSteer() {
//     const _leftSteerBackgroundImage = 'assets/seires_1_steer_ab.png';
//     const _leftControllerImage = 'assets/seires_1_steer_thumb_left.png';
//     return Steer(
//       left: _steerPosition,
//       right: _steerElse,
//       bottom: ScreenUtil().setHeight(150),
//       width: ScreenUtil().setHeight(380.0),
//       height: ScreenUtil().setHeight(380.0),
//       radio: 0.3,
//       changeValue: setVertical,
//       direction: SteerMoveEnum.Both,
//       backgroundImg: _leftSteerBackgroundImage,
//       controlImg: _leftControllerImage,
//       recoverFunction: () {
//         return _lockStatus;
//       },
//     );
//   }

//   Widget _rightSteer() {
//     const _rightSteerBackgroundImage = 'assets/seires_1_steer_cd.png';
//     const _rightControllerImage = 'assets/seires_1_steer_thumb.png';
//     return Steer(
//       left: _steerElse,
//       right: _steerPosition,
//       bottom: ScreenUtil().setHeight(150),
//       width: ScreenUtil().setHeight(380.0),
//       height: ScreenUtil().setHeight(380.0),
//       radio: 0.3,
//       changeValue: setHorizontal,
//       direction: SteerMoveEnum.Both,
//       backgroundImg: _rightSteerBackgroundImage,
//       controlImg: _rightControllerImage,
//       recoverFunction: () {
//         return _lockStatus;
//       },
//     );
//   }

//   //档位容器
//   Widget _levelContainer(final double _width, final double _height,
//       {double right, double top}) {
//     double __right = right ?? (ScreenUtil().screenWidth - _width) / 2;
//     double __top = top ?? (ScreenUtil().screenHeight - _height) / 2;
//     double __padding = 10;
//     return Positioned(
//       right: __right,
//       top: __top,
//       width: _width,
//       height: _height,
//       child: Container(
//         decoration: BoxDecoration(
//           borderRadius: BorderRadius.all(Radius.circular(4.0)),
//           image: DecorationImage(
//               image: AssetImage('assets/seires_1_level_bg.png'),
//               fit: BoxFit.fill),
//         ),
//         width: _width,
//         height: _height,
//         padding: EdgeInsets.all(__padding),
//         child: Column(
//           children: [
//             _levelBtn(0, _width - 2 * __padding, _width - 2 * __padding),
//             Expanded(child: Container()),
//             _levelBtn(1, _width - 2 * __padding, _width - 2 * __padding),
//             Expanded(child: Container()),
//             _levelBtn(2, _width - 2 * __padding, _width - 2 * __padding),
//           ],
//         ),
//       ),
//     );
//   }

//   Widget _levelBtn(final int _level, double width, double height) {
//     return GestureDetector(
//       onTap: _btnFunction[_level],
//       child: Container(
//         decoration: BoxDecoration(
//           borderRadius: BorderRadius.all(Radius.circular(4.0)),
//         ),
//         width: width,
//         height: height,
//         padding: EdgeInsets.all(ScreenUtil().setHeight(10)),
//         child: Image(
//           image: AssetImage(btnImageNames[_level]),
//         ),
//       ),
//     );
//   }

//   @override
//   void setVertical({double x, double y}) {
//     //离圆心偏移距离大于0.3才计算，小于0.3 则发送0
//     //print('setVertical x= $x y = $y');
//     int xval = (x > 0.3
//         ? (((x - 0.3) / 0.7) * 24).toInt()
//         : x < -0.3
//             ? 0x80 - (((0.3 + x) / 0.7) * 24).toInt()
//             : 0x80);

//     //print('xvalue = $xvalue , x = $x  ');
//     final int yval = (y > 0.3
//         ? 0x80 + (((y - 0.3) / 0.7) * 24).toInt()
//         : y < -0.3
//             ? (((-0.3 - y) / 0.7) * 24).toInt()
//             : 0x80);

//     if (_eStatus) {
//       xval = yval;
//     }
//     if (_fStatus) {
//       _cValue = yval;
//       setHorizontalCommand();
//     }
//     //print('x = $xval  y = $y');

//     DeviceDataContext.instance.devcie
//         .getDataAt(4, yval * AppConfig.instance.channelASpeed);
//     YundongjiaBle.instance.sendAdvertiseCommand(DeviceDataContext
//         .instance.devcie
//         .getDataAt(5, xval * AppConfig.instance.channelBSpeed));
//   }

//   @override
//   void setHorizontal({double x, double y}) {
//     //离圆心偏移距离大于0.3才计算，小于0.3 则发送0
//     final int xval = (x > 0.3
//         ? (((x - 0.3) / 0.7) * 24).toInt()
//         : x < -0.3
//             ? 0x80 - (((0.3 + x) / 0.7) * 24).toInt()
//             : 0x80);
//     _dValue = xval;

//     //print('xvalue = $x , x = $x  ');
//     int yval = (y > 0.3
//         ? 0x80 + (((y - 0.3) / 0.7) * 24).toInt()
//         : y < -0.3
//             ? (((-0.3 - y) / 0.7) * 24).toInt()
//             : 0x80);
//     if (_fStatus) {
//       yval = _cValue;
//     } else {
//       _cValue = yval;
//     }
//     setHorizontalCommand();
//   }

//   void setHorizontalCommand() {
//     //print('x = $xval  y = $y')

//     DeviceDataContext.instance.devcie
//         .getDataAt(6, _cValue * AppConfig.instance.channelCSpeed);
//     YundongjiaBle.instance.sendAdvertiseCommand(DeviceDataContext
//         .instance.devcie
//         .getDataAt(7, _dValue * AppConfig.instance.channelDSpeed));
//   }

//   //设置按钮事件处理
//   @override
//   void onSettingTap() {
//     Navigator.of(context).push(
//       MaterialPageRoute(builder: (context) {
//         return RemoteSetting40Page();
//       }),
//     );
//   }

//   Widget _slider() {
//     return Positioned(
//       right: ScreenUtil().setHeight(400.0),
//       left: ScreenUtil().setHeight(400.0),
//       top: ScreenUtil().setHeight(100.0),
//       height: ScreenUtil().setHeight(80.0),
//       child: Container(
//         child: Row(
//           mainAxisAlignment: MainAxisAlignment.spaceAround,
//           children: [
//             _sliderLeft(),
//             _sliderRight(),
//           ],
//         ),
//       ),
//     );
//   }

//   Widget _steer() {
//     return Positioned(
//       right: ScreenUtil().setHeight(10.0),
//       left: ScreenUtil().setHeight(10.0),
//       top: ScreenUtil().setHeight(150.0),
//       bottom: ScreenUtil().setHeight(150.0),
//       child: Container(
//         padding: EdgeInsets.only(bottom: 50, top: 50),
//         child: Row(
//           mainAxisAlignment: MainAxisAlignment.spaceAround,
//           children: [
//             _leftSteer(),
//             _rightSteer(),
//           ],
//         ),
//       ),
//     );
//   }

//   Widget _settings() {
//     return Positioned(
//       right: ScreenUtil().setHeight(400.0),
//       left: ScreenUtil().setHeight(400.0),
//       bottom: ScreenUtil().setHeight(120.0),
//       height: ScreenUtil().setHeight(100.0),
//       child: Container(
//         child: Row(
//           mainAxisAlignment: MainAxisAlignment.spaceAround,
//           children: [
//             _settingBtn(),
//             _lockBtn(),
//           ],
//         ),
//       ),
//     );
//   }

//   //指示表
//   Widget _settingBtn() {
//     return GestureDetector(
//       onTap: onSettingTap,
//       child: Container(
//         height: ScreenUtil().setHeight(100.0),
//         width: ScreenUtil().setHeight(100.0),
//         decoration: BoxDecoration(
//           image: DecorationImage(
//             image: AssetImage('assets/seires_1_setting.png'),
//           ),
//         ),
//       ),
//     );
//   }

//   //指示表
//   Widget _lockBtn() {
//     return GestureDetector(
//       onTap: onLockBtn,
//       child: Container(
//         height: ScreenUtil().setHeight(100.0),
//         width: ScreenUtil().setHeight(100.0),
//         decoration: BoxDecoration(
//           image: DecorationImage(
//             image: AssetImage(_lockStatus
//                 ? 'assets/seires_1_lock.png'
//                 : 'assets/seires_1_lock_on.png'),
//           ),
//         ),
//       ),
//     );
//   }

//   Widget _sliderLeft() {
//     return SliderSelf(
//       width: ScreenUtil().setHeight(90),
//       height: ScreenUtil().setHeight(80),
//       controlImg: 'assets/switch_thumb.png',
//       direction: SliderTypeEnum.Horizontal,
//       max: 2,
//       value: 1,
//       changeValue: (v) {
//         if (v == 0xFF) {
//           _eStatus = true;
//         } else {
//           _eStatus = false;
//         }
//       },
//     );
//   }

//   Widget _sliderRight() {
//     return SliderSelf(
//       width: ScreenUtil().setHeight(90),
//       height: ScreenUtil().setHeight(80),
//       controlImg: 'assets/switch_thumb.png',
//       direction: SliderTypeEnum.Horizontal,
//       max: 2,
//       value: 1,
//       changeValue: (v) {
//         if (v == 0xFF) {
//           _fStatus = true;
//         } else {
//           _fStatus = false;
//         }
//       },
//     );
//   }

//   @override
//   void onLockBtn() {
//     setState(() {
//       _lockStatus = !_lockStatus;
//     });

//     AppConfig.instance.controlLockStatus = (_lockStatus ? 0 : 1);
//     bus.emit('SteerReset', 'null');
//   }
// }

import 'package:blocks_blkk/components/return_button.dart';
import 'package:blocks_blkk/components/slider_self.dart';
import 'package:blocks_blkk/components/steer.dart';
import 'package:blocks_blkk/event/event_bus.dart';
import 'package:blocks_blkk/page/remote_setting_40.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:yundongjia_ble/yundongjia_ble.dart';
import 'package:flutter/material.dart';

import '../app_configure.dart';
import 'device_data_context.dart';
import 'entity/function_enum.dart';
import 'function_page.dart';

/*
 * 遥控界面 3
 * FunctionEntry -> RomotePage
 */
class RemotePage40 extends FunctionPage {
  RemotePage40({super.key});

  @override
  _RemotePage40State createState() => _RemotePage40State(FunctionType.Remote);
}

class _RemotePage40State extends FunctionPageState {
  _RemotePage40State(FunctionType functionType)
      : super(functionType: functionType);

  int _cValue = 0;
  int _dValue = 0;
  bool _lockStatus = AppConfig.instance.controlLockStatus == 0;
  bool _eStatus = false;
  bool _fStatus = false;

  List<String> btnImageNames = [
    'assets/seires_1_level_1.png',
    'assets/seires_1_level_2.png',
    'assets/seires_1_level_3.png',
  ];

  double _steerPosition = ScreenUtil().setHeight(150);
  double _steerElse = 0;
  int locks = 0;
  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    YundongjiaBle.instance.stop();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    debugPrint('====== remote V40 build');

    return background(
      <Widget>[
        ReturnButton(),
        bluetootnBtn(shape: BoxShape.rectangle),
        _steer(),
        _slider(),
        _settings(),
      ],
      useBackground: false,
    );
  }

  // Widget _leftSteer(final backgroundImg, final controlImg) {
  //   return Steer(
  //     left: _steerPosition,
  //     right: _steerElse,
  //     bottom: ScreenUtil().setHeight(150),
  //     width: ScreenUtil().setHeight(380.0),
  //     height: ScreenUtil().setHeight(380.0),
  //     radio: 0.35,
  //     changeValue: setVertical,
  //     direction: SteerMoveEnum.Vertical,
  //     backgroundImg: 'assets/$backgroundImg',
  //     controlImg: 'assets/$controlImg',
  //   );
  // }

  // Widget _rightSteer(final backgroundImg, final controlImg) {
  //   return Steer(
  //     left: _steerElse,
  //     right: _steerPosition,
  //     bottom: ScreenUtil().setHeight(150),
  //     width: ScreenUtil().setHeight(380.0),
  //     height: ScreenUtil().setHeight(380.0),
  //     radio: 0.35,
  //     changeValue: setHorizontal,
  //     direction: SteerMoveEnum.Horizontal,
  //     backgroundImg: 'assets/$backgroundImg',
  //     controlImg: 'assets/$controlImg',
  //   );
  // }

  Widget _leftSteer() {
    const _leftSteerBackgroundImage = 'assets/seires_1_steer_ab.png';
    const _leftControllerImage = 'assets/seires_1_steer_thumb_left.png';
    return Steer(
      left: _steerPosition,
      right: _steerElse,
      bottom: ScreenUtil().setHeight(150),
      width: ScreenUtil().setHeight(380.0),
      height: ScreenUtil().setHeight(380.0),
      radio: 0.3,
      changeValue: setVertical,
      direction: SteerMoveEnum.Both,
      backgroundImg: _leftSteerBackgroundImage,
      controlImg: _leftControllerImage,
      recoverFunction: () {
        return _lockStatus;
      },
    );
  }

  Widget _rightSteer() {
    const _rightSteerBackgroundImage = 'assets/seires_1_steer_cd.png';
    const _rightControllerImage = 'assets/seires_1_steer_thumb.png';
    return Steer(
      left: _steerElse,
      right: _steerPosition,
      bottom: ScreenUtil().setHeight(100),
      width: ScreenUtil().setHeight(380.0),
      height: ScreenUtil().setHeight(380.0),
      radio: 0.3,
      changeValue: setHorizontal,
      direction: SteerMoveEnum.Both,
      backgroundImg: _rightSteerBackgroundImage,
      controlImg: _rightControllerImage,
      recoverFunction: () {
        return _lockStatus;
      },
    );
  }

  void setHorizontalCommand() {
    YundongjiaBle.instance.sendAdvertiseCommand(
        DeviceDataContext.instance.devcie.getDataAt(7, _dValue));
  }

  Widget _steer() {
    return Positioned(
      right: ScreenUtil().setHeight(10.0),
      left: ScreenUtil().setHeight(10.0),
      top: ScreenUtil().setHeight(150.0),
      bottom: ScreenUtil().setHeight(150.0),
      child: Container(
        padding: EdgeInsets.only(bottom: 20, top: 20),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            _leftSteer(),
            _rightSteer(),
          ],
        ),
      ),
    );
  }

  Widget _slider() {
    return Positioned(
      right: ScreenUtil().setHeight(400.0),
      left: ScreenUtil().setHeight(400.0),
      top: ScreenUtil().setHeight(100.0),
      height: ScreenUtil().setHeight(80.0),
      child: Container(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            _sliderLeft(),
            _sliderRight(),
          ],
        ),
      ),
    );
  }

  //////////
  @override
  void setVertical({required double x, required double y}) {
    //离圆心偏移距离大于0.3才计算，小于0.3 则发送0
    //print('setVertical x= $x y = $y');
    int xval = (x > 0.3
        ? (((x - 0.3) / 0.7) * 24).toInt()
        : x < -0.3
            ? 0x80 - (((0.3 + x) / 0.7) * 24).toInt()
            : 0x80);

    //print('xvalue = $xvalue , x = $x  ');
    final int yval = (y > 0.3
        ? 0x80 + (((y - 0.3) / 0.7) * 24).toInt()
        : y < -0.3
            ? (((-0.3 - y) / 0.7) * 24).toInt()
            : 0x80);

    if (_eStatus) {
      xval = yval;
    }
    if (_fStatus) {
      _cValue = yval;
      setHorizontalCommand();
    }
    //print('x = $xval  y = $y');

    DeviceDataContext.instance.devcie
        .getDataAt(4, (yval * AppConfig.instance.channelASpeed) as int);
    YundongjiaBle.instance.sendAdvertiseCommand(DeviceDataContext
        .instance.devcie
        .getDataAt(5, (xval * AppConfig.instance.channelBSpeed) as int));
  }

  @override
  void setHorizontal({required double x, required double y}) {
    //离圆心偏移距离大于0.3才计算，小于0.3 则发送0
    final int xval = (x > 0.3
        ? (((x - 0.3) / 0.7) * 24).toInt()
        : x < -0.3
            ? 0x80 - (((0.3 + x) / 0.7) * 24).toInt()
            : 0x80);
    _dValue = xval;

    //print('xvalue = $x , x = $x  ');
    int yval = (y > 0.3
        ? 0x80 + (((y - 0.3) / 0.7) * 24).toInt()
        : y < -0.3
            ? (((-0.3 - y) / 0.7) * 24).toInt()
            : 0x80);
    if (_fStatus) {
      yval = _cValue;
    } else {
      _cValue = yval;
    }
    setHorizontalCommand();
  }

  Widget _settings() {
    return Positioned(
      right: ScreenUtil().setHeight(400.0),
      left: ScreenUtil().setHeight(400.0),
      bottom: ScreenUtil().setHeight(120.0),
      height: ScreenUtil().setHeight(100.0),
      child: Container(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            _settingBtn(),
            _lockBtn(),
          ],
        ),
      ),
    );
  }

  //指示表
  Widget _settingBtn() {
    return GestureDetector(
      onTap: onSettingTap,
      child: Container(
        height: ScreenUtil().setHeight(100.0),
        width: ScreenUtil().setHeight(100.0),
        decoration: const BoxDecoration(
          image: DecorationImage(
            image: AssetImage('assets/seires_1_setting.png'),
          ),
        ),
      ),
    );
  }

  //指示表
  Widget _lockBtn() {
    return GestureDetector(
      onTap: onLockBtn,
      child: Container(
        height: ScreenUtil().setHeight(100.0),
        width: ScreenUtil().setHeight(100.0),
        decoration: BoxDecoration(
          image: DecorationImage(
            image: AssetImage(_lockStatus
                ? 'assets/seires_1_lock.png'
                : 'assets/seires_1_lock_on.png'),
          ),
        ),
      ),
    );
  }

  Widget _sliderLeft() {
    return SliderSelf(
      width: ScreenUtil().setHeight(90),
      height: ScreenUtil().setHeight(80),
      controlImg: 'assets/switch_thumb.png',
      direction: SliderTypeEnum.Horizontal,
      max: 2,
      value: 1,
      changeValue: (v) {
        if (v == 0xFF) {
          _eStatus = true;
        } else {
          _eStatus = false;
        }
      },
    );
  }

  Widget _sliderRight() {
    return SliderSelf(
      width: ScreenUtil().setHeight(90),
      height: ScreenUtil().setHeight(80),
      controlImg: 'assets/switch_thumb.png',
      direction: SliderTypeEnum.Horizontal,
      max: 2,
      value: 1,
      changeValue: (v) {
        if (v == 0xFF) {
          _fStatus = true;
        } else {
          _fStatus = false;
        }
      },
    );
  }

  @override
  void onLockBtn() {
    setState(() {
      _lockStatus = !_lockStatus;
    });
    EventBus.instance.emit('SteerReset', 'null');
    AppConfig.instance.controlLockStatus = (_lockStatus ? 0 : 1);
  }

  @override
  void onSettingTap() {
    Navigator.of(context).push(
      MaterialPageRoute(builder: (context) {
        return RemoteSetting40Page();
      }),
    );
  }
}
